<?php

//Yii::import('zii.widgets.CPortlet');

class RecentPosts extends CWidget
{
	public $title='Recent Posts';
	public $maxPosts=10;

	public function getRecentPosts()
	{
		return Post::model()->findRecentPosts($this->maxPosts);
	}

	public function run()
	{
		$this->render('recentPosts');
	}
}